package com.bluebench.bigul.service.processor;

import java.util.HashMap;
import java.util.Map;


public abstract class GenericProcessor implements Processor{

	public static final int ELEMENT_PROCESSOR=0;
	public static final int ATTRIBUTE_PROCESSOR=1;
	public static final int PARAMETER_PROCESSOR=2;
	public static final int COLLECTION_PROCESSOR=3;
	public static final int CHAINED_PROCESSOR=4;
	public static final int PARAGRAPH_PART_PROCESSOR=5;
	protected static Map<String,String> methodMap;
	
	
	static{
		methodMap = new HashMap<String,String>();
		methodMap.put("listitem","add");
		methodMap.put("scalePer","scalePercent");
		methodMap.put("scaleAbs","scalePercent");
		methodMap.put("cell","addCell");
		methodMap.put("content","add");
		methodMap.put("section","addSection");
		methodMap.put("build", "build");
		methodMap.put("border", "border");
		methodMap.put("fill", "fill");
		methodMap.put("borderAndFill", "borderAndFill");
		methodMap.put("borderAndShade", "borderAndShade");
		methodMap.put("shade", "shade");
		methodMap.put("concentric", "concentric");
		methodMap.put("copy", "copy");
	}
	
	
	
	public static Processor getInstance(int type){
		
		switch(type){
		
			case ELEMENT_PROCESSOR:
				return new ElementProcessor();				
			case ATTRIBUTE_PROCESSOR:
				return new AttributeProcessor();
			case PARAMETER_PROCESSOR:
				return new ParameterProcessor();
			case COLLECTION_PROCESSOR:
				return new CollectionProcessor();
			case CHAINED_PROCESSOR:
				return new ChainedAttributeProcessor();
			case PARAGRAPH_PART_PROCESSOR:
				return new ParagraphPartProcessor();	
			default:
				return null;	
		
		}		
		
	}
	
	
}
